/**
 * @author caiwl
 * @date 2020/10/23 9:55
 */
public class LeetCode {
    public static void main(String[] args) {
        int x = -1245;
        String s = String.valueOf(x);
        if (x < 0) {
            s = String.valueOf(Math.abs(x));
        }
        char[] arr = s.toCharArray();
        int len = arr.length;
        char temp;
        for (int i = 0; i < len; i++) {
            if (i < len - i) {
                temp = arr[i];
                arr[i] = arr[len - 1 - i];
                arr[len - 1 - i] = temp;
            }
        }
        if (x < 0) {
            System.out.println(Integer.valueOf("-" + String.valueOf(arr)));
        } else {
            System.out.println(Integer.valueOf(String.valueOf(arr)));
        }
    }
}
